

#pragma once

namespace Den{

    namespace CHECK_SUPPORT_SAME
    {
        typedef char (&No)[1];
        template<class T1, class T2>
            No operator == (const T1&, const T2&);

        template <class T1, class T2>
        struct opEqualExists
        {
            template<class U>
                static const U& ref();

            typedef decltype( ref<T1>()==ref<T2>() )
                Type;

            enum { value = !::std::is_same<Type, No>::value };
        };
    }//namespace CHECK_SUPPORT_SAME


    template<class T1, class T2=T1> struct support_same
    {
        enum { value = CHECK_SUPPORT_SAME::opEqualExists<T1,T2>::value };
    };


}//namespace Den





